package org.chen.wordwave.base;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.blankj.utilcode.util.BarUtils;
import com.gyf.immersionbar.ImmersionBar;

import org.chen.wordwave.act.VersionManager;

import java.util.Objects;

public abstract class BaseActivity extends AppCompatActivity {
    public static Integer layoutResId;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        layoutResId = getLayoutResId();
        if (layoutResId != null) {
            setContentView(layoutResId);
        }
        Objects.requireNonNull(getSupportActionBar()).hide();
        ImmersionBar.with(this)
                .fullScreen(true)
                .init();
        BarUtils.setNavBarVisibility(this, false);
        init();
    }

    public abstract Integer getLayoutResId();

    public abstract void init();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ImmersionBar.with(this).removeSupportAllView();
    }
}